
package com.bkhech.netty.httpwebsocket.server;

import cn.hutool.core.lang.Snowflake;
import io.netty.channel.group.ChannelGroup;
import io.netty.channel.group.DefaultChannelGroup;
import io.netty.util.concurrent.GlobalEventExecutor;

/**
 * SnowFlakeUtil
 *
 * @author guowm
 * @date 2024-11-11
 */
public class SnowFlakeUtil {
    private static volatile Snowflake snowflake;

    private SnowFlakeUtil() {
    }

    public static Snowflake getInstance() {
        if (snowflake == null) {
            synchronized (SnowFlakeUtil.class) {
                if (snowflake == null) {
                    snowflake = new Snowflake();
                }
            }
        }
        return snowflake;
    }
}
